
import Toast from './Toast'

export default {

  install (Vue, options) {
    const myDiv = document.createElement('div')
    document.body.appendChild(myDiv)

    const Toast1 = Vue.extend(Toast)// 1、创建组件构造器
    //2. 创建实例
    const instance = new Toast1({ el: myDiv })

    Vue.prototype.$toast = function (myOptions) {
      instance.show(myOptions)
    }
  }
}
